<?php
$option = get_option('tvpresident_1_settings');
$catID = get_query_var('cat');
?>
<?php dynamic_sidebar('top_sidebar') ?>

  <div class="divlist">
    <div class="divtitle">List type of Business </div>
    <div class="divcontent category">
      <ul>
        <?php 
          $idObj = get_category_by_slug('business');
          $categories = get_categories(array('hide_empty'=>0, 'parent'=>$idObj->cat_ID));
          foreach ($categories as $category) { ?>
          <?php if($category->cat_ID!=1){ ?>
          <li <?php if($catID==$category->cat_ID) echo 'class="active"' ?>><a href="<?php echo get_category_link($category->cat_ID); ?>"><?php echo $category->cat_name; ?></a></li>
          <?php } ?>
        <?php } ?>
      </ul>
    </div>
  </div>
        <img src="<?php echo bloginfo('template_url'); ?>/img/liked.png" width="289">

  <div class="divnation">
    <div class="divtitle">Nation by area</div>
    <div class="divcontent">
      <a href="<?php echo site_url() ?>/nation"><img src="<?php echo bloginfo('template_url'); ?>/img/background-nation.png" width="289"></a>
    </div>
  </div>
  
  <div class="">
    <a href="<?php echo site_url() ?>/category/news" style="position:absolute;margin-top:60px;margin-left:80px"><img src="<?php echo bloginfo('template_url'); ?>/img/seebtn.png"></a>
    <img src="<?php echo bloginfo('template_url'); ?>/img/banner.png" width="289">
  </div>
  
  <div class="divpresident">
    <div class="divtitle">New information President BLOG </div>
    <div class="divcontent">
       <?php
          wp_reset_query();
          $idObj = get_category_by_slug('news'); 
          query_posts(array('order'=>'DESC','category__in' => array($idObj->cat_ID),'posts_per_page'=>3));
          while (have_posts()): the_post(); ?>
          <div class="news">
            <div class="img">
              <a href="<?php the_permalink() ?>"><?php the_post_thumbnail(array(100,100),array('style'=>'width:100px;height:100px;')); ?></a>
            </div>
            <div class="newscontent">
            <span class="date"><?php the_time('m-d-Y h:i'); ?></span><br>
            <span class="newstitle"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></span><br>
            <p class="description"><?php echo mb_substr(strip_tags(get_the_excerpt()), 0, 80).'...'; ?></p>
            </div>
            <div style="clear:both;"></div>
        </div>
         <?php endwhile; ?>
      
      <div class="more"> <a href="<?php echo site_url() ?>/category/news">Next <img src="<?php echo bloginfo('template_url'); ?>/img/next.png"></a>
      </div>
      <div style="clear:both;"></div>
    </div>
  </div>